<?php
require_once 'SessionAuth.class.php';

// 设置响应头为JSON
header('Content-Type: application/json');

// 创建登录验证实例
$auth = new SessionAuth();

// 获取POST数据
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';
$captcha = $_POST['captcha'] ?? '';

// 进行登录验证
$result = $auth->login($username, $password, $captcha);

// 返回JSON结果
echo json_encode($result);


?>